package com.jiyun.feign;

import com.github.pagehelper.PageInfo;
import com.jiyun.model.day10.Record;
import com.jiyun.model.day11.Roll;
import com.jiyun.vo.day10.RecordVo;
import com.jiyun.vo.day10.TopicDto2;
import com.jiyun.vo.day11.RollDto;
import com.jiyun.vo.day11.RollVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author yangYingJie
 * @Date 2023/8/24 17：20
 **/
@FeignClient("day11-roll")
public interface FeignRoll {
    //查询最热竞技
    @RequestMapping("/roll/findDesc")
    public List<Roll> findDesc();

    //-- 查竞赛所在培训人数
    @RequestMapping("/traineeRoll/findTrainee/{id}")
    public Integer findTrainee(@PathVariable("id") Integer id);

    /**
     * 根据当前传递过来的id查询它的试卷并查找最大题目数量
     *
     * @return
     */
    @RequestMapping("/roll/findCAll")
    public List<RollVo> findCAll(@RequestBody Record record);


    //点击下一题触发新增选项
    @RequestMapping("/roll/addRecord")
    public void addRecord(@RequestBody Record record);

    //查询当前登录人的历史记录
    @RequestMapping("/roll/findRecord")
    public List<Record> findRecord(@RequestBody TopicDto2 dto);

    //查询当前登录人、竞赛、试卷的分数 / 试卷数量
    @RequestMapping("/roll/findEndFen")
    public Integer findEndFen(@RequestBody TopicDto2 dto);

    /**
     * 查询当前培训的试卷Roll
     *
     * @param id
     * @return
     */
    @RequestMapping("/roll/findTraineeRoll/{id}")
    public List<RollVo> findTraineeRoll(@PathVariable("id") Integer id);

    /**
     * //根据试卷id查找题目数量
     */
    @RequestMapping("/roll/findRollTopicNum/{id}")
    public Integer findRollTopicNum(@PathVariable("id") Integer id);
    /**
     * 分页展示试卷信息
     * @param dto
     * @return
     */
    @RequestMapping("/roll/findShowAll")
    public PageInfo<RollVo> findShowAll(@RequestBody RollDto dto);

    //-- 个人中心当前登录人的历史记录
    @RequestMapping("/roll/findByIdRecord/{id}")
    public List<RecordVo> findByIdRecord(@PathVariable("id")Integer id);

    //当前登录人测试数量
    @RequestMapping("/roll/findRollNum/{id}")
    public Integer findRollNum(@PathVariable("id")Integer id);
}
